
import axios from '@/utils/request'

//获取城市列表
export function sortCityFn(data:any){
    return axios({
        url:'/sortCity',
        method:'post',
        data
    })
}
//地址接口
interface iAddress{
    userid:string,
    name:string,
    tel:string,
    province:string,
    city:string,
    county:string,
    addressDetail:string,
    isDefault:Boolean,
}
//添加地址
export function addAddressFn(data:iAddress){
    return axios({
        url:'/address/add',
        method:'post',
        data
    })
}
//查询默认地址
export function defaultAddressFn(data:{
    userid:string,
    header:{
        token:string
    }
}){
    return axios({
        url:'/address/defaultAddress',
        method:'post',
        data
    })
}
//更新地址接口
export function updateAddressFn(data:iAddress){
    return axios({
        url:'/address/update',
        method:'post',
        data
    })
}
//地址列表
export function addressListFn(data:{
    userid:string
}){
    return axios({
        url:'/address/list',
        method:'get',
        data
    })
}
//删除地址
export function deleteAddressFn(data:{
    addressid:string
}){
    return axios({
        url:'/address/delete',
        method:'POST',
        data
    })
}